package twentytwenty;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: Zahi
 * @Description:
 * @Date Created in 2020-12-13 12:26
 * @Modified By:
 */
public class FirstUniqChar_387 {
    public static void main(String[] args) {

    }

    public static int firstUniqChar(String s) {
        int len = s.length();
        if(len == 1) return 0;
        for (int i = 0; i < len; i++) {
            int is = 0, isj = 0;
            for (int j = 0; j < len; j++) {
                if(i == j) {
                    continue;
                }
                isj = 1;
                if (s.charAt(i) == s.charAt(j)) {
                    is = 1;
                    break;
                }
            }
            if(is == 0 && isj == 1) {
                return i;
            }
        }
        return -1;
    }
}
